// javamaps
// Copyright (c) 2010 Bebeselea Elena
package Data;
import Core.*;
import java.util.*;
import java.io.*;

public class Tile implements Serializable {
    private ObjectId ID_;
    private int level_;
    private String fileName_;

    /*
     * Constructori.
     */
    public Tile(){
    }

    public Tile(ObjectId ID, int level, String fileName){
        ID_ = ID;
        level_ = level;
        fileName_ = fileName;
    }

     /*
     * Metode publice.
     */
     public ObjectId Id(){ return ID_; }
     public void SetId(ObjectId  ID){ ID_ = ID; }

     public int Level(){ return level_; }
     public void SetLevel(int level){ level_ = level; }

     public String FileName(){ return fileName_; }
     public void SetFileName(String fileName){ fileName_ = fileName; }



     @Override
     public boolean equals(Object obj) {
        if(obj == null) return false;
        if(this == obj) return true;
        if(this.getClass() != obj.getClass()) return false;

        Tile tile = (Tile)obj;
        return ( tile.ID_ == ID_ );
    }

     @Override
     public int hashCode() { return ID_.Id();}

     // Pentru debugging.
     @Override
     public String toString() {
        return "Id=" + ID_ + ", lev=" + level_ + "file=" + fileName_;
    }
}
